﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace shfa.snomtastic.systray.components
{
    public static class Win32
    {
        public const Int32 GW_HWNDFIRST = 0; // Get first Window handle
        public const Int32 GW_HWNDNEXT = 2; // Get next window handle
        public const Int32 SW_HIDE = 0;
        public const Int32 SW_SHOW = 5;

        [DllImport("User32.dll")]
        public static extern Int32 FindWindow(String lpClassName, String lpWindowName);
        
        [DllImport("User32.dll")]
        public static extern Int32 SetForegroundWindow(IntPtr hWnd);
        
        [DllImport("User32.dll")]
        public static extern Boolean EnumWindows(Delegate lpEnumFunc, int lParam);
        
        [DllImport("User32.dll")]
        public static extern Boolean EnumChildWindows(IntPtr hWndParent, Delegate lpEnumFunc, int lParam);
        
        [DllImport("User32.dll")]
        public static extern Int32 GetWindow(IntPtr hWnd, int wCmd);
        
        [DllImport("User32.dll")]
        public static extern Int32 GetClassName(IntPtr hWnd, StringBuilder s, int nMaxCount);
        
        [DllImport("User32.dll")]
        public static extern Int32 GetWindowText(IntPtr hWnd, StringBuilder s, int nMaxCount);
        
        [DllImport("User32.dll")]
        public static extern Int32 GetWindowTextLength(int hwnd);
        
        [DllImport("user32.dll", EntryPoint = "GetDesktopWindow")]
        public static extern int GetDesktopWindow();
        
        [DllImport("User32.dll")]
        public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
        
        [DllImport("User32.dll")]
        public static extern IntPtr GetParent(IntPtr hWnd);
        
        [DllImport("user32.dll")]
        public static extern IntPtr GetWindowModuleFileName(IntPtr hWnd, StringBuilder title, int size);
        
        [DllImport("User32.dll")]
        public static extern bool IsWindowVisible(IntPtr hWnd);
        
        [DllImport("user32.dll")]
        public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
        
               
    }

}
